//
//  NYSubjectAnswerSubmitCell.m
//  NiuWaJiaoYu
//
//  Created by MinLison on 2018/1/9.
//  Copyright © 2018年 niuwaketang. All rights reserved.
//

#import "NYSubjectAnswerSubmitCell.h"
@interface NYSubjectAnswerSubmitCell ()
@property(nonatomic, strong) QMUIGhostButton *submitBtn;
@end
@implementation NYSubjectAnswerSubmitCell
+ (CGFloat)heightForObject:(id)object identifier:(NSString *)identifier atIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView
{
        return __WGHeight(70);
}
- (BOOL)shouldUpdateCellWithObject:(NICellObject *)object atIndexPath:(NSIndexPath *)indexPath
{
        self.indexPath = indexPath;
        self.redoModel = (NYReDoModel *)object.userInfo;
        return YES;
}
- (void)setRedoModel:(NYReDoModel *)redoModel
{
        _redoModel = redoModel;
        [self updateContent];
}
- (void)updateContent
{
}
- (void)setupView
{
        [super setupView];
        [self.contentView addSubview:self.submitBtn];
        [self.submitBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.edges.equalTo(self.contentView).valueOffset([NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(15, 15, 15, 15)]);
        }];
}
- (QMUIGhostButton *)submitBtn
{
        if (_submitBtn == nil) {
                _submitBtn = [[QMUIGhostButton alloc] init];
                _submitBtn.ghostColor = [UIColor whiteColor];
                _submitBtn.clipsToBounds = YES;
                _submitBtn.cornerRadius = 20;
                _submitBtn.userInteractionEnabled = NO;
                [_submitBtn setTitle:@"提交" forState:(UIControlStateNormal)];
                _submitBtn.titleLabel.font = WGSystem15Font;
                [_submitBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
                
                [_submitBtn setBackgroundImage:[UIImage imageWithColor:UIColorHex(0xFA8D00)] forState:(UIControlStateNormal)];
        }
        return _submitBtn;
}
@end
